/-boot
/-docs
/-editor
/-files
/-files-old
/-imports
/-layout
/-shell
/-storage
/-tests ...
/-tests/files
/-tests/storage ...
/-tests/storage/attached ...
AttachedStorageTests.ts
DomStorageTests.ts
IndexedDBStorageTests.ts
LocalStorageStorageTests.ts
WebSQLStorageTests.ts
TestCase.html
TestCase.ts
TestPage.css
TestPage.html
TestPage.ts
_sampleTests.ts
teapo-tests.html
teapo-tests.ts
/-typings
Dom.ts
TypeScriptService.ts
functions.ts
ko.ts
nteapo.html
persistence.api.ts
persistence.ts
shell.ts
teapo.html
teapo.ts
try.html
try.js
xxxxxxxxxx
            file: (name, values) => callback(new Error('LoadStorageRecipient.file should not be called.')),
 
342
            (error, update) => {
343
              this._detect.detectStorageAsync(
344
                ukey,
345
                (error, load) => {
346
                  callback(load.editedUTC === 2345 ? null : new Error('Incorrect editedUTC value ' + load.editedUTC + ' (expected 2345).'));
347
                });
348
            });
349
        });
350
    }
351
​
352
    updateTwice_loadAgain_secondValue(callback: (error: Error) => void) {
353
      var ukey = this._generateKey();
354
      this._detect.detectStorageAsync(
355
        ukey,
356
        (error, load) => {
357
          load.load({
358
            files: () => { },
359
            file: (name, values) => callback(new Error('LoadStorageRecipient.file should not be called.')),
360
            completed: (updater: teapo.storage.attached.UpdateStorage) => {
361
              updater.update(
362
                'file.txt', 'property1', 'value2',
363
                (error: Error) => updater.update(
364
                  'file.txt', 'property1', 'value4',
365
                  (error: Error) => {
366
                    this._detect.detectStorageAsync(
367
                      ukey,
368
                      (error, load) => {
369
                        var files: any = {};
370
                        load.load({
371
                          files: () => { },
372
                          file: (name, values) => files[name] = values,
373
                          completed: (updater) => {
374
                            var fileTxt = files['file.txt'];
375
                            if (!fileTxt) {
376
                              callback(new Error('File is not reported on subsequent load.'));
377
                            }
378
                            else {
379
                              var propertyValue = fileTxt['property1'];
380
                              callback(propertyValue === 'value4' ? null : new Error('Wrong value ' + propertyValue));
381
                            }
382
                          },
383
                          failed: (error) => callback(error)
384
                        });
385
                      });
386
                  }));
387
            },
388
            failed: (error) => callback(error)
389
          });
390
        });
391
    }
392
​
393
    private _generateKey(): string {
394
      return Math.random() + '-' + Math.random();
395
    }
396
​
397
  }
398
​
399
}
/tests/storage/attached/AttachedStorageTests.ts
371:0 load(recipient: teapo.storage.attached.LoadStorageRecipient): void /** Load all the data from the storage, returning an instance of UpdateStorage in the end. */